package com.kotlin.dongdong.demo.ui.login

/**
 * Created by dongdongzheng on 2018/2/12.
 */
class LoginPresenter : LoginContract.Presenter() {
    override fun getBook() {
        //TODO("not implemented") //To change body of created functions use File | Settings |
        // File Templates.

        mModel!!.getBook().subscribe(
                { res -> mView!!.getBookResult(res) },
                { error ->
                    mView!!.onResultError(error.toString())
                })
    }

    override fun onStart() {
        // TODO("not implemented") //To change body of created functions use File | Settings |
        // File Templates.
    }

    override fun login(phone: String, pwd: String) {
        //TODO("not implemented") //To change body of created functions use File | Settings |
        // File Templates.
        mModel!!.login(phone, pwd).subscribe(
                { res -> mView!!.loginRexult(res) },
                { error ->
                    mView!!.onResultError(error.toString())
                })

    }
}